package com.center.biz.impl;

import com.center.api.model.EduArticle;
import com.center.api.remote.RemoteEduArticleService;
import com.center.biz.dao.EduArticleMapper;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service(version = "1.0",interfaceClass = RemoteEduArticleService.class)
public class RemoteEduArticleServiceImpl implements RemoteEduArticleService{

    @Autowired
    private EduArticleMapper eduArticleMapper;

    @Override
    public int delete(int id) {
        return this.eduArticleMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int saveArticle(EduArticle eduArticle) {
        return this.eduArticleMapper.insertSelective(eduArticle);
    }

    @Override
    public EduArticle getById(int id) {
        return this.eduArticleMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<EduArticle> list(EduArticle eduArticle) {
        return this.eduArticleMapper.list(eduArticle);
    }

    @Override
    public int update(EduArticle eduArticle) {
        return this.eduArticleMapper.updateByPrimaryKeySelective(eduArticle);
    }
}
